package ru.zombator.taskman.core.query.payload;

import java.util.ArrayList;
import java.util.List;

import ru.zombator.taskman.core.domain.Datestamp;
import ru.zombator.taskman.core.domain.ITask;
import ru.zombator.taskman.core.domain.IWorker;

/**
 * Запрос на модификацию полей задачи (назначенные работники,
 * имя, дата начала и конца, описание)
 * 
 * @author nvamelichev
 *
 */
public class ModifyTaskFieldsRequest implements IPayload {
	private static final long serialVersionUID = 1L;

	// обязательные поля //////////////////////////////////////////////////////
	private ITask task;
	private String name;
	private Datestamp start;
	private Datestamp end;
	///////////////////////////////////////////////////////////////////////////
	// необязательные поля ////////////////////////////////////////////////////
	private String description;
	private List<IWorker> workers = new ArrayList<IWorker>();
	
	public ModifyTaskFieldsRequest(ITask task, String name, Datestamp start, Datestamp end) {
		this.task = task;
		this.name = name;
		this.start = start;
		this.end = end;
	}
	
	public ModifyTaskFieldsRequest withDescription(String description) {
		this.description = description;
		return this;
	}
	
	public ModifyTaskFieldsRequest withWorker(IWorker worker) {
		this.workers.add(worker);
		return this;
	}
	
	public ITask getTask() {
		return this.task;
	}
	
	public String getName() {
		return this.name;
	}

	public String getDescription() {
		return this.description;
	}
	
	public Datestamp getStart() {
		return this.start;
	}
	
	public Datestamp getEnd() {
		return this.end;
	}
}
